<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/14
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>ERP系统 - 公寓修缮</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css">
</head>
<body>
<h3>公寓修缮记录管理</h3>
<div class="actions">
    <shiro:hasPermission name="sys:record:add">
        <div>
            <a class="btn btn-primary" href="addrecord">添加修缮记录</a>
        </div>
    </shiro:hasPermission>
    <shiro:hasPermission name="sys:record:select">
        <form action="like">
            <select name="field">
                <option value="hAddress">房屋信息</option>
                <option value="loName">负责人</option>
            </select>
            <input type="text" name="name" placeholder="输入关键字查询">
            <input type="submit" value="搜索">
        </form>
    </shiro:hasPermission>

</div>

<table class="list">
    <tr>
        <th>序号</th>
        <th>房屋信息</th>
        <th>负责人</th>
        <th>修缮说明</th>
        <th>修缮时间</th>
        <th>修缮结果</th>
        <th>操作</th>

    </tr>
    <c:forEach var="record" items="${pageInfo.list}" varStatus="status">
        <tr>
            <td>${record.reId}</td>
            <td>${record.house.hAddress}</td>
            <td>${record.logistics.loName}</td>
            <td>${record.reRemark}</td>
            <td>${record.reTime}</td>
            <td>${record.reResult}</td>
            <td>
                <a class="fa fa-info" title="详情" href="find?reId=${record.reId}"></a>
                &nbsp;&nbsp;
                <shiro:hasPermission name="sys:record:update">
                    <a class="fa fa-pencil" title="编辑" href="update?reId=${record.reId}"></a>
                </shiro:hasPermission>
                <shiro:hasPermission name="sys:record:delete">
                    &nbsp;&nbsp;
                    <a class="fa fa-remove" title="删除" href="delete?reId=${record.reId}" onclick="confirmDelete(1)"></a>
                </shiro:hasPermission>

            </td>
        </tr>
    </c:forEach>

</table>
<div class="pager-info">
    <div class="col-md-6">
        当前第${pageInfo.pageNum}页,总共${pageInfo.pages}页,总共${pageInfo.total}条记录
    </div>
    <div class="col-md-6">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li><a href="list?pn=1">首页</a></li>
                <c:if test="${pageInfo.hasPreviousPage}">
                    <li>
                        <a href="list?pn=${pageInfo.pageNum-1}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                </c:if>
                <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
                    <li <c:if test="${page_Num==pageInfo.pageNum}">
                        class="active"
                    </c:if>><a href="list?pn=${page_Num}">${page_Num}</a></li>

                </c:forEach>
                <c:if test="${pageInfo.hasNextPage}">
                    <li>
                        <a href="list?pn=${pageInfo.pageNum+1}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </c:if>
                <li><a href="list?pn=${pageInfo.pages}">末页</a></li>
            </ul>
        </nav>
    </div>
</div>
<script src="${pageContext.request.contextPath}/lib/jquery/jquery.js"></script>
<script>
    function confirmDelete(id){
        if (confirm("确定要删除吗？")) {
            alert('发送删除请求，刷新页面（不要异步）');
        }
        return false;
    }
</script>
</body>
</html>